﻿<phone:PhoneApplicationPage 
    x:Class="TodayHumor.Start"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:local="clr-namespace:TodayHumor"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="728" 
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.BackgroundColor="{StaticResource PhoneAccentColor}"
    shell:SystemTray.ForegroundColor="WhiteSmoke"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot는 모든 페이지 내용이 배치되는 루트 표입니다.-->
    <Grid x:Name="LayoutRoot" Background="Transparent" Language="ko-kr">
        <Grid Height="110" VerticalAlignment="Top">
            <TextBlock Text="{StaticResource AppName}" FontSize="54"
                       VerticalAlignment="Bottom" Margin="15,0,0,15"/>
        </Grid>
        <controls:Panorama x:Name="panorama" Margin="0,110,0,0" Background="#202020"
                           SelectionChanged="PanoramaSelectionChanged">
            <!-- 게시판 리스트 파노라마 아이템 -->
            <controls:PanoramaItem>
                <StackPanel Margin="5,-8,10,0">
                    <StackPanel Orientation="Horizontal" Margin="0,0,0,15">
                        <toolkit:PhoneTextBox x:Name="SearchTextBox" Hint="게시판 이름으로 검색하기" Width="370"
                                              TextChanged="SearchTextBoxTextChanged"/>
                        <Button Content="X" Background="{StaticResource PhoneBackgroundBrush}" BorderThickness="2" Margin="-10,0,0,0" 
                                FontWeight="Normal" Height="74" FontSize="22" Click="SearchTextBoxDeleteButtonClick"/>
                    </StackPanel>
                    
                    <ListBox x:Name="BoardListListBox" Height="480">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Name}" FontSize="28" Margin="5,0,0,5" Foreground="{StaticResource PhoneForegroundBrush}"
                                           Tap="BoardListTextBlockTap"/>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </StackPanel>
            </controls:PanoramaItem>
            <controls:PanoramaItem>
                <StackPanel Margin="0,0,0,0">
                    <TextBlock Text="열람 기록" FontSize="24" Margin="5,0,0,20" FontWeight="Bold"/>
                    <ListBox x:Name="HistoryMultiSelectList" Height="500">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Width="390" Margin="0,0,0,15" Tap="HistoryStackPanelTap" toolkit:TiltEffect.IsTiltEnabled="True">
                                    <toolkit:ContextMenuService.ContextMenu>
                                        <toolkit:ContextMenu Language="ko-kr">
                                            <toolkit:MenuItem Header="삭제하기" Tap="HistoryMenuItemTap"/>
                                        </toolkit:ContextMenu>
                                    </toolkit:ContextMenuService.ContextMenu>
                                    <StackPanel Width="390" Margin="5,0,5,5">
                                        <TextBlock Text="{Binding Title}" FontSize="24" TextWrapping="Wrap" Margin="0,0,0,10" Foreground="{StaticResource PhoneForegroundBrush}"/>
                                        <StackPanel Orientation="Horizontal" Margin="5,0,0,5">
                                            <Image Height="20">
                                                <Image.Source>
                                                    <BitmapImage UriSource="{Binding Board}"/>
                                                </Image.Source>
                                            </Image>
                                            <TextBlock Text="{Binding Writer}" Foreground="Gray" Margin="8,-1,7,0"/>
                                        </StackPanel>
                                    </StackPanel>
                                    <Rectangle Height="2" HorizontalAlignment="Stretch" Fill="{StaticResource PhoneForegroundBrush}" Opacity=".3"/>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </StackPanel>
            </controls:PanoramaItem>
        </controls:Panorama>
    </Grid>
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar>
            <shell:ApplicationBar.Buttons>
                <shell:ApplicationBarIconButton IconUri="Images/Icons/key.png" Text="로그인" Click="ApplicationBarIconButton_Click"/>
                <shell:ApplicationBarIconButton IconUri="Images/Icons/refresh.png" Text="새로 고침"/>
                <shell:ApplicationBarIconButton IconUri="Images/Icons/settings.png" Text="설정"/>
            </shell:ApplicationBar.Buttons>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="URI로 이동.."/>
                <shell:ApplicationBarMenuItem Text="설정"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:SlideTransition Mode="SlideRightFadeIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:SlideTransition Mode="SlideLeftFadeIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:SlideTransition Mode="SlideRightFadeOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:SlideTransition Mode="SlideLeftFadeOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>
</phone:PhoneApplicationPage>